#pragma once
#include "VC_Drawable.h"
#include "C_BitShip.h"

class C_SpaceShip :
	public VC_Drawable
{
private:
	float m_scale;
	std::vector<C_BitShip*> m_bits;
	S_Pointf m_pos;
	C_BitShip *m_addBit;

	std::unique_ptr<S_MousePressMove> m_evMousePress;

public:
	C_SpaceShip();
	virtual ~C_SpaceShip();

	void setPos(float x, float y) { m_pos.x = x; m_pos.y = y; }
	S_Pointf pos() { return m_pos; }

	void addBit(C_BitShip* bs, int x, int y);
	void addBit(C_BitShip* bs);
	int size() { return m_bits.size(); }

	void removeBit(C_BitShip* bs);

	//////////////////////////////////////////////////////////////////
	////////////	MAIN FUNCTION
	virtual void handleEvent(sf::Event e);
	virtual void render();
	virtual void update();

	inline float* getPtrScale() { return &m_scale; }

	bool testCoordPlace(int x, int y);
	C_BitShip* find(int x, int y);
	bool isAddingBit() { return (m_addBit == nullptr) ? false : true; }
};

